package com.sjq.service.impl;


import com.sjq.mapper.ClassificationMapper;
import com.sjq.model.entity.Classification;
import com.sjq.service.IClassificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 帖子分类Service业务层处理
 *
 * @author sjq
 * @date 2021-12-08
 */
@Service
public class classificationServiceImpl implements IClassificationService
{
    @Autowired
    private ClassificationMapper topicClassificationMapper;

    /**
     * 查询帖子分类
     *
     * @param id 帖子分类ID
     * @return 帖子分类
     */
    @Override
    public Classification selectClassificationById(Long id)
    {
        return topicClassificationMapper.selectClassificationById(id);
    }

    @Override
    public List<Classification> selectClassificationListAll() {
        return topicClassificationMapper.selectClassificationListAll();
    }

    /**
     * 查询帖子分类列表
     *
     * @param topicClassification 帖子分类
     * @return 帖子分类
     */
    @Override
    public List<Classification> selectClassificationList(Classification topicClassification)
    {
        return topicClassificationMapper.selectClassificationList(topicClassification);
    }

    /**
     * 新增帖子分类
     *
     * @param topicClassification 帖子分类
     * @return 结果
     */
    @Override
    public int insertClassification(Classification topicClassification)
    {
        return topicClassificationMapper.insertClassification(topicClassification);
    }

    /**
     * 修改帖子分类
     *
     * @param topicClassification 帖子分类
     * @return 结果
     */
    @Override
    public int updateClassification(Classification topicClassification)
    {
        return topicClassificationMapper.updateClassification(topicClassification);
    }

    /**
     * 批量删除帖子分类
     *
     * @param ids 需要删除的帖子分类ID
     * @return 结果
     */
    @Override
    public int deleteClassificationByIds(Long[] ids)
    {
        return topicClassificationMapper.deleteClassificationByIds(ids);
    }

    /**
     * 删除帖子分类信息
     *
     * @param id 帖子分类ID
     * @return 结果
     */
    @Override
    public int deleteClassificationById(Long id)
    {
        return topicClassificationMapper.deleteClassificationById(id);
    }
}
